1. Field of the Invention
The present invention relates to electronic compass systems and more particularly to calibration and compensation of electronic compass systems for use in connection with the indication of a vehicle's heading.
2. Description of the Relevant Art
The electronic compass is classified within a family of instruments referred to as "magnetometers" whose function is to detect and to measure the magnitude and/or direction of magnetic fields. Electronic compasses are used, for example, within vehicles such as automobiles. In a compass for use in a vehicle, it is desirable to compensate the compass to correct for stray magnetic fields and ferromagnetic material in the vicinity of the sensor. For accuracy, a second correction for variations in the earth's magnetic field as a function of the geographic location of the vehicle is desirable. For example, in the United States, the magnetic variation between true north and magnetic north from the east coast to the west coast is approximately 40.degree.. A compass system installed in a vehicle therefore should include means for correcting for the earth's magnetic field variation as well as means for compensating for the particular installation of the compass in an individual vehicle.
One type of electronic compass, commonly known as a "flux gate" magnetometer, is capable of detecting magnetic fields due to a phenomenon of magnetic saturation of an iron alloy core. Referring to FIGS. 1A-1D, the operating principles of the flux gate magnetometer is next explained. When referring to magnetic fields, fictional entities called "lines of flux" are employed. The lines are used to illustrate the direction and intensity of a magnetic field.
Referring to FIG. 1A, an iron alloy strip 10 having a high "permeability" and a very sharp "saturation characteristic" is disposed in parallel to the earth's magnetic field represented by the lines of flux 12. An iron alloy strip having a high permeability with a very sharp saturation characteristic can be analogously understood as having a very low "resistance" to magnetic flux, but, once a certain density of magnetic flux is flowing through it, will "saturate" and thereafter have a very high resistance to the passage of additional flux.
When iron alloy strip 10 is positioned parallel to the earth's magnetic field as in FIG. 1A, some of the lines of flux 12 divert and follow a path through alloy strip 10 since it offers less resistance to the flow of flux than does the surrounding air.
If a coil of wire 14 is placed around alloy strip 10 as in FIG. 1B, and a sufficient amount of electrical current is driven through coil 14 to "saturate" alloy strip 10, the lines of flux 12 due to the earth's field no longer divert to flow through the strip since its permeability is greatly reduced.
Thus, the strip of iron alloy 10 acts as a "flux gate" to the lines of flux 12 of the earth's magnetic field. When alloy strip 10 is not saturated, the "gate is open" and the surrounding lines of flux 12 bunch together and flow through alloy strip 10. When alloy strip 10 is saturated by passing a sufficient electrical current through coil 14, the "gate is closed" and the lines of flux 12 do not divert but instead resume paths along or very near their original paths.
A basic law of electricity dictates that when a line of magnetic flux "cuts", or passes through, an electrical conductor, a current is induced in the conductor. Thus, if an alternating current is passed through coil 14, referred to as a drive winding, the flux gate makes transitions between its opened and closed states at twice the frequency of the alternating current, and therefore the lines of flux 12 from the earth's field move in and out of the alloy strip 10 at twice the frequency of the alternating current. It is possible to arrange the lines of flux 12 to pass through a second electrical conductor, referred to as a sense winding, each time they transit between the alloy strip and the surrounding air, thereby inducing a current in the second conductor. The induced current is proportional to the intensity of that component of the earth's magnetic field which lies parallel to alloy strip 10.
One problem introduced, however, is that when alloy strip 10 is saturated, additional lines of flux are created by the magnetic field induced by current flow through drive winding 14. These additional lines of flux must be considered when devising a scheme to measure the earth's magnetic field.
One scheme used to solve this problem is illustrated in FIG. 1C. Two identical alloy strips 16 and 18 are used, and the saturation, or drive, windings 14A and 14B are arranged such that a closed magnetic circuit is formed. The lines of flux from the earth's field are diverted into and expelled from both alloy strips 16 and 18 each time the strips change between the saturated and unsaturated states. A sense winding 19 is positioned around the entire assembly as shown such that the sense winding is crossed at each passage of the lines of external flux to thus produce a voltage signal indicative of only the external flux lines. This result occurs since the lines of flux induced by drive windings 14A and 14B can build up and collapse without cutting sense winding 19.
A toroidal core 20 as shown in FIG. 1D can be used to serve the same function as the two alloy strips 16 and 18. The toroidal core flux gate includes drive winding 14 and sensing winding 19. With no air gaps at the ends, toroidal core 20 is somewhat more efficient magnetically.
Referring next to FIGS. 2A-2G, the operational details of circuitry within a typical prior art flux gate magnetometer are explained. The drive winding is excited by a square wave of a suitable frequency and amplitude (as shown in FIG. 2A) such that the core is saturated half way through each half-cycle. When the core saturates, the impedance of the drive winding is reduced to a very low value, and virtually shorts out the amplifiers supplying the drive voltage such that the drive voltage is reduced to nearly zero for the remainder of the half-cycle (FIG. 2B). As the polarity of the drive voltage reverses at the end of the first half-cycle, the core unsaturates and allows the drive voltage to reach full amplitude until the approximate center of the second half-cycle, when saturation again occurs and the drive voltage returns to near zero.
As explained above, any external magnetic field in the vicinity will be drawn into the core when the core is unsaturated, and will be expelled when it becomes saturated. Each time the external lines of flux are drawn into the core, they pass through the sense winding and generate a voltage pulse (shown in FIG. 2C) having an amplitude which is proportional to the intensity of that component of the external field which is parallel to the centerline of the sense winding. The polarity of this pulse is determined by the polarity of the external magnetic field with respect to the sense winding. When the lines of flux are expelled from the core, they cut the sense winding in the opposite direction and generate another voltage pulse of the same amplitude but of opposite polarity. Thus, the pulses of FIG. 2C are indicative of both the amplitude and direction of the earth's magnetic field with respect to the sense winding.
It should be noted that the pulse pattern of FIG. 2C is repeated twice for each cycle of the driving frequency of FIG. 2A. Consequently, the information is provided from the magnetometer at twice the frequency of the driving voltage, and thus the designation "second harmonic flux-gate magnetometer" is attached.
Several approaches for measuring the amplitude and direction of the pulse pattern are possible. For one approach, the sense winding is tuned to a frequency of twice the drive frequency to convert the series of pulses into a sine wave as shown in FIG. 2D having an amplitude proportional to the amplitude of the pulses. It should be noted that since the core is driven to saturate halfway through each drive cycle, an even spacing of the positive and negative signal pulses of FIG. 2C results and thus the pulses are efficiently converted into a sine wave by the tuned sense coil.
To convert the sine-wave signal of FIG. 2D into a DC signal, the sine wave signal is passed through a "phase-sensitive demodulator". A reference voltage which consists of a square wave having twice the frequency of and the same phase as the drive voltage as shown in FIG. 2E is required by the demodulator. The phase-sensitive demodulator inverts the polarity of the signal from the sense winding every time the reference voltage goes positive. Thus for the conditions shown in FIGS. 2E and 2F, the negative-going half of the sine wave is inverted positive and the positive-going half is unaltered, thus resulting in the waveform of FIG. 2G. This waveform is passed through a low-pass filter and therefore a positive DC signal results having an amplitude which is proportional to that of the original sine wave signal.
If the direction of the magnetic field is reversed with respect to the magnetometer, the phase of the signal shown in FIG. 2F is shifted by 180 degrees with respect to the reference voltage (FIG. 2E) and the positive half-cycles of the signal voltage are inverted, thus resulting in a negative DC signal.
Another approach for measuring the amplitude and direction of the pulse pattern induced in the sense winding involves a microcomputer. A demodulator controlled by the microcomputer receives the pulse signal through a wide band amplifier. The demodulator processes the pulse signal shown in FIG. 2C and provides a DC output signal having an amplitude proportional to the pulse signal. This approach eliminates phase shift errors due to component value changes and eliminates the need for adjusting tuned circuits in production.
The overall result for either approach is shown in FIG. 3 wherein the DC output signal level variation is recorded as the sensitive axis of the magnetometer (the centerline of the sense winding) is kept horizontal and rotated through 360.degree. with respect to the earth's magnetic field. Orientation reference positions of the flux gate sensor are indicated with reference letters A-E. For example, when the flux gate is positioned with its sensitive axis parallel to the north-south direction as in orientation B, the output signal is maximum.
If a second sense winding 19B is wrapped around a toroidal core in quadrature with respect to the first sense winding 19A as shown in FIG. 1E, a second DC voltage is induced in the additional sense winding. A compass having two sense windings arranged in quadrature is referred to as a two axis compass. As illustrated in FIG. 4, as the orientation of the two axis compass heading is varied (from -180 degrees to 180 degrees with respect to north), the output voltage signals from both windings vary in a manner similar to that of FIG. 3. Extrema in the second sense winding voltage occur wherever the output voltage across the first sense winding is zero. Thus, by monitoring the DC voltage signals generated across the sense windings, the directional heading of the two axis compass can be determined since every directional orientation corresponds to exactly one set of DC voltage levels induced in the sense windings.
When used within a vehicle, the flux gate sensor of such an electronic compass can be mounted on the vehicle such that the axis of one of the sensing windings is parallel to the longitudinal axis of the vehicle. The direction of the vehicle can thereby be determined. For example, if the vehicle is headed due north and the flux gate sensor is mounted on the vehicle such that the axis of the second sensing winding is oriented as in position C parallel to the longitudinal axis of the vehicle, it is apparent with reference to FIG. 4 that the output signal from the first sensing winding is zero while the output signal from the second sensing winding is maximum.
Unfortunately, although the theory of operation of an electronic compass having a flux gate sensor is straight-forward, many problems have been encountered in practice when used within vehicles such as automobiles. One problem described earlier is compensation for variations in the earth's magnetic field as a function of geographic location. Another problem described earlier is compensation for stray magnetic fields and ferromagnetic material in the vicinity of the sensor.
To correct for errors in magnetic variations between true north and magnetic north, the automobile is aligned in a direction known to be true north and, after depressing a variation switch, a reading is taken by a microprocessor which monitors the sensor output signals. The angular difference between this reading and what the reading should be for true north represents the variation correction and is stored in a memory for use in adjusting successive directional signals.
To compensate for stray magnetic fields exterior to the vehicle, such as disturbances introduced when driving over railroad tracks or near other large steel structures that have become magnetized, software filtering may be employed. Using software filtering, variations in the sensor signals that are characteristic of the stray disturbances are detected and filtered to prevent unwanted changes in the heading indications of the compass.
Several correction techniques may be used to correct for the effects on the compass of residual magnetic fields present in the particular vehicle to which the compass is mounted. For one method, called a drive in a circle method, the calibration is initiated with a switch or other means. The car is then driven in a circle on a relatively flat road at a constant speed. During this time, the system takes a number (say 100) of readings of the sensor winding output signals, searching for maximum and minimum values. By recording the extrema of each of the sensing winding output signals, the appropriate compensation factor can be applied by the processing unit since the extrema are known to occur at certain flux gate positions relative to magnetic north. The processing unit mathematically derives four compensation factors which are used to adjust the reading from the two axes before computing the relative heading angle. These adjustments compensate for distortions in the magnetic fields caused by magnetic material in the vehicle near the sensor. The adjusted or compensated readings give more accurate readings of the vehicle heading. This calibration technique is well known in the art, as shown, for example, in U.S. Pat. No. 3,991,361 issued Nov. 9, 1976, and in Farr, C. and Anstey, E.; Reduction of Errors In Magnetic Aspect Sensors By A System of Ground Calibration; Royal Aircraft Establishment Technical Report No. 66092; March, 1966. The above documents are incorporated herein by reference.
The four factors referred to above are offset compensation (two values, one for each axis) and gain compensation (two values, one for each axis). Offset compensation is a linear offset of the sensor readings from stray magnetic fields caused by magnetic material in the vicinity of the sensor. Stray magnetic fields cause the largest errors and affect the compass accuracy in all directions. Gain compensation is a scalar correction that corrects for different magnetic sensitivities of the sensor along its two axes caused by shunting effects of ferrous material in the vicinity of the sensor. Gain errors are sometimes called elliptical errors since the locus of points from the sensor describe an ellipse instead of a true circle when one axis has a greater sensitivity than the other. Gain errors are much less critical than offset errors and only affect the compass accuracy when neither flux gate sensor axis is aligned close to magnetic north.
The offset caused by magnetized material in the vehicle is constant for all orientations of the vehicle and thus can be computed as the average of the maximum and minimum values recorded as the vehicle is driven in a circle, i.e. (Vmax+Vmin)/2=offset compensation. The gain errors can be compensated by normalizing the offset compensated readings to a maximum value of +/- 1. This normalizing factor is therefore equal to the reciprocal of one half the difference between the maximum and minimum values recorded as the vehicle is driven in a circle i.e. 2/(Vmax-Vmin)=gain compensation.
In implementing the drive in a circle correction method, extrema in the sensor output voltage of each axis are typically determined by monitoring the zero-voltage crossings of the first derivative with respect to time of the sensor output voltage. However, for a sinusoidal waveform, the slope of the sensor output voltage in the vicinity of the extremum is extremely low. Thus, the exact location and value of an extremum is difficult to determine since the sensing circuitry is subject to the effects of electrical noise.